<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>GtkToggleButton</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
<link rel="home" href="index.html" title="GTK+ 3 参考手册">
<link rel="up" href="ButtonWidgets.html" title="按钮和开关">
<link rel="prev" href="gtk3-GtkRadioButton.html" title="GtkRadioButton">
<link rel="next" href="gtk3-GtkLinkButton.html" title="GtkLinkButton">
<meta name="generator" content="GTK-Doc V1.18 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
<tr valign="middle">
<td><a accesskey="p" href="gtk3-GtkRadioButton.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="ButtonWidgets.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
<th width="100%" align="center">GTK+ 3 参考手册</th>
<td><a accesskey="n" href="gtk3-GtkLinkButton.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr>
<tr><td colspan="5" class="shortcuts">
<a href="#gtk3-GtkToggleButton.synopsis" class="shortcut">Top</a>
                   | 
                  <a href="#gtk3-GtkToggleButton.description" class="shortcut">Description</a>
</td></tr>
</table>
<div class="refentry">
<a name="gtk3-GtkToggleButton"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="gtk3-GtkToggleButton.top_of_page"></a>GtkToggleButton</span></h2>
<p>GtkToggleButton</p>
</td>
<td valign="top" align="right"></td>
</tr></table></div>
<div class="refsynopsisdiv">
<a name="gtk3-GtkToggleButton.synopsis"></a><h2>Synopsis</h2>
<pre class="synopsis">
#include &lt;gtk/gtk.h&gt;

struct              <a class="link" href="gtk3-GtkToggleButton.html#GtkToggleButton" title="struct GtkToggleButton">GtkToggleButton</a>;
<a class="link" href="gtk3-GtkWidget.html#GtkWidget" title="GtkWidget"><span class="returnvalue">GtkWidget</span></a> *         <a class="link" href="gtk3-GtkToggleButton.html#gtk-toggle-button-new" title="gtk_toggle_button_new ()">gtk_toggle_button_new</a>               (<em class="parameter"><code><span class="type">void</span></code></em>);
<a class="link" href="gtk3-GtkWidget.html#GtkWidget" title="GtkWidget"><span class="returnvalue">GtkWidget</span></a> *         <a class="link" href="gtk3-GtkToggleButton.html#gtk-toggle-button-new-with-label" title="gtk_toggle_button_new_with_label ()">gtk_toggle_button_new_with_label</a>    (<em class="parameter"><code>const <a href="../glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *label</code></em>);
<a class="link" href="gtk3-GtkWidget.html#GtkWidget" title="GtkWidget"><span class="returnvalue">GtkWidget</span></a> *         <a class="link" href="gtk3-GtkToggleButton.html#gtk-toggle-button-new-with-mnemonic" title="gtk_toggle_button_new_with_mnemonic ()">gtk_toggle_button_new_with_mnemonic</a> (<em class="parameter"><code>const <a href="../glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *label</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="gtk3-GtkToggleButton.html#gtk-toggle-button-set-mode" title="gtk_toggle_button_set_mode ()">gtk_toggle_button_set_mode</a>          (<em class="parameter"><code><a class="link" href="gtk3-GtkToggleButton.html#GtkToggleButton" title="struct GtkToggleButton"><span class="type">GtkToggleButton</span></a> *toggle_button</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> draw_indicator</code></em>);
<a href="../glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            <a class="link" href="gtk3-GtkToggleButton.html#gtk-toggle-button-get-mode" title="gtk_toggle_button_get_mode ()">gtk_toggle_button_get_mode</a>          (<em class="parameter"><code><a class="link" href="gtk3-GtkToggleButton.html#GtkToggleButton" title="struct GtkToggleButton"><span class="type">GtkToggleButton</span></a> *toggle_button</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="gtk3-GtkToggleButton.html#gtk-toggle-button-toggled" title="gtk_toggle_button_toggled ()">gtk_toggle_button_toggled</a>           (<em class="parameter"><code><a class="link" href="gtk3-GtkToggleButton.html#GtkToggleButton" title="struct GtkToggleButton"><span class="type">GtkToggleButton</span></a> *toggle_button</code></em>);
<a href="../glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            <a class="link" href="gtk3-GtkToggleButton.html#gtk-toggle-button-get-active" title="gtk_toggle_button_get_active ()">gtk_toggle_button_get_active</a>        (<em class="parameter"><code><a class="link" href="gtk3-GtkToggleButton.html#GtkToggleButton" title="struct GtkToggleButton"><span class="type">GtkToggleButton</span></a> *toggle_button</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="gtk3-GtkToggleButton.html#gtk-toggle-button-set-active" title="gtk_toggle_button_set_active ()">gtk_toggle_button_set_active</a>        (<em class="parameter"><code><a class="link" href="gtk3-GtkToggleButton.html#GtkToggleButton" title="struct GtkToggleButton"><span class="type">GtkToggleButton</span></a> *toggle_button</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> is_active</code></em>);
<a href="../glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            <a class="link" href="gtk3-GtkToggleButton.html#gtk-toggle-button-get-inconsistent" title="gtk_toggle_button_get_inconsistent ()">gtk_toggle_button_get_inconsistent</a>  (<em class="parameter"><code><a class="link" href="gtk3-GtkToggleButton.html#GtkToggleButton" title="struct GtkToggleButton"><span class="type">GtkToggleButton</span></a> *toggle_button</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="gtk3-GtkToggleButton.html#gtk-toggle-button-set-inconsistent" title="gtk_toggle_button_set_inconsistent ()">gtk_toggle_button_set_inconsistent</a>  (<em class="parameter"><code><a class="link" href="gtk3-GtkToggleButton.html#GtkToggleButton" title="struct GtkToggleButton"><span class="type">GtkToggleButton</span></a> *toggle_button</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> setting</code></em>);
</pre>
</div>
<div class="refsect1">
<a name="gtk3-GtkToggleButton.description"></a><h2>Description</h2>
<p>
</p>
</div>
<div class="refsect1">
<a name="gtk3-GtkToggleButton.details"></a><h2>Details</h2>
<div class="refsect2">
<a name="GtkToggleButton"></a><h3>struct GtkToggleButton</h3>
<pre class="programlisting">struct GtkToggleButton {
};
</pre>
<p>
</p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-toggle-button-new"></a><h3>gtk_toggle_button_new ()</h3>
<pre class="programlisting"><a class="link" href="gtk3-GtkWidget.html#GtkWidget" title="GtkWidget"><span class="returnvalue">GtkWidget</span></a> *         gtk_toggle_button_new               (<em class="parameter"><code><span class="type">void</span></code></em>);</pre>
<p>
</p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-toggle-button-new-with-label"></a><h3>gtk_toggle_button_new_with_label ()</h3>
<pre class="programlisting"><a class="link" href="gtk3-GtkWidget.html#GtkWidget" title="GtkWidget"><span class="returnvalue">GtkWidget</span></a> *         gtk_toggle_button_new_with_label    (<em class="parameter"><code>const <a href="../glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *label</code></em>);</pre>
<p>
</p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-toggle-button-new-with-mnemonic"></a><h3>gtk_toggle_button_new_with_mnemonic ()</h3>
<pre class="programlisting"><a class="link" href="gtk3-GtkWidget.html#GtkWidget" title="GtkWidget"><span class="returnvalue">GtkWidget</span></a> *         gtk_toggle_button_new_with_mnemonic (<em class="parameter"><code>const <a href="../glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *label</code></em>);</pre>
<p>
Creates a new <a class="link" href="gtk3-GtkToggleButton.html#GtkToggleButton" title="struct GtkToggleButton"><span class="type">GtkToggleButton</span></a> containing a label. The label
will be created using <a class="link" href="gtk3-GtkLabel.html#gtk-label-new-with-mnemonic" title="gtk_label_new_with_mnemonic ()"><code class="function">gtk_label_new_with_mnemonic()</code></a>, so underscores
in <em class="parameter"><code>label</code></em> indicate the mnemonic for the button.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>label</code></em> :</span></p></td>
<td>the text of the button, with an underscore in front of the
mnemonic character</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>a new <a class="link" href="gtk3-GtkToggleButton.html#GtkToggleButton" title="struct GtkToggleButton"><span class="type">GtkToggleButton</span></a>
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-toggle-button-set-mode"></a><h3>gtk_toggle_button_set_mode ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                gtk_toggle_button_set_mode          (<em class="parameter"><code><a class="link" href="gtk3-GtkToggleButton.html#GtkToggleButton" title="struct GtkToggleButton"><span class="type">GtkToggleButton</span></a> *toggle_button</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> draw_indicator</code></em>);</pre>
<p>
Sets whether the button is displayed as a separate indicator and label.
You can call this function on a checkbutton or a radiobutton with
<em class="parameter"><code>draw_indicator</code></em> = <a href="../glib/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> to make the button look like a normal button
</p>
<p>
This function only affects instances of classes like <a class="link" href="gtk3-GtkCheckButton.html#GtkCheckButton" title="struct GtkCheckButton"><span class="type">GtkCheckButton</span></a>
and <a class="link" href="gtk3-GtkRadioButton.html#GtkRadioButton" title="struct GtkRadioButton"><span class="type">GtkRadioButton</span></a> that derive from <a class="link" href="gtk3-GtkToggleButton.html#GtkToggleButton" title="struct GtkToggleButton"><span class="type">GtkToggleButton</span></a>,
not instances of <a class="link" href="gtk3-GtkToggleButton.html#GtkToggleButton" title="struct GtkToggleButton"><span class="type">GtkToggleButton</span></a> itself.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>toggle_button</code></em> :</span></p></td>
<td>a <a class="link" href="gtk3-GtkToggleButton.html#GtkToggleButton" title="struct GtkToggleButton"><span class="type">GtkToggleButton</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>draw_indicator</code></em> :</span></p></td>
<td>if <a href="../glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a>, draw the button as a separate indicator
and label; if <a href="../glib/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a>, draw the button like a normal button</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-toggle-button-get-mode"></a><h3>gtk_toggle_button_get_mode ()</h3>
<pre class="programlisting"><a href="../glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            gtk_toggle_button_get_mode          (<em class="parameter"><code><a class="link" href="gtk3-GtkToggleButton.html#GtkToggleButton" title="struct GtkToggleButton"><span class="type">GtkToggleButton</span></a> *toggle_button</code></em>);</pre>
<p>
Retrieves whether the button is displayed as a separate indicator
and label. See <a class="link" href="gtk3-GtkToggleButton.html#gtk-toggle-button-set-mode" title="gtk_toggle_button_set_mode ()"><code class="function">gtk_toggle_button_set_mode()</code></a>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>toggle_button</code></em> :</span></p></td>
<td>a <a class="link" href="gtk3-GtkToggleButton.html#GtkToggleButton" title="struct GtkToggleButton"><span class="type">GtkToggleButton</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>
<a href="../glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the togglebutton is drawn as a separate indicator
and label.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-toggle-button-toggled"></a><h3>gtk_toggle_button_toggled ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                gtk_toggle_button_toggled           (<em class="parameter"><code><a class="link" href="gtk3-GtkToggleButton.html#GtkToggleButton" title="struct GtkToggleButton"><span class="type">GtkToggleButton</span></a> *toggle_button</code></em>);</pre>
<p>
</p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-toggle-button-get-active"></a><h3>gtk_toggle_button_get_active ()</h3>
<pre class="programlisting"><a href="../glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            gtk_toggle_button_get_active        (<em class="parameter"><code><a class="link" href="gtk3-GtkToggleButton.html#GtkToggleButton" title="struct GtkToggleButton"><span class="type">GtkToggleButton</span></a> *toggle_button</code></em>);</pre>
<p>
</p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-toggle-button-set-active"></a><h3>gtk_toggle_button_set_active ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                gtk_toggle_button_set_active        (<em class="parameter"><code><a class="link" href="gtk3-GtkToggleButton.html#GtkToggleButton" title="struct GtkToggleButton"><span class="type">GtkToggleButton</span></a> *toggle_button</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> is_active</code></em>);</pre>
<p>
</p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-toggle-button-get-inconsistent"></a><h3>gtk_toggle_button_get_inconsistent ()</h3>
<pre class="programlisting"><a href="../glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            gtk_toggle_button_get_inconsistent  (<em class="parameter"><code><a class="link" href="gtk3-GtkToggleButton.html#GtkToggleButton" title="struct GtkToggleButton"><span class="type">GtkToggleButton</span></a> *toggle_button</code></em>);</pre>
<p>
Gets the value set by <a class="link" href="gtk3-GtkToggleButton.html#gtk-toggle-button-set-inconsistent" title="gtk_toggle_button_set_inconsistent ()"><code class="function">gtk_toggle_button_set_inconsistent()</code></a>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>toggle_button</code></em> :</span></p></td>
<td>a <a class="link" href="gtk3-GtkToggleButton.html#GtkToggleButton" title="struct GtkToggleButton"><span class="type">GtkToggleButton</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>
<a href="../glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the button is displayed as inconsistent, <a href="../glib/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> otherwise</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-toggle-button-set-inconsistent"></a><h3>gtk_toggle_button_set_inconsistent ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                gtk_toggle_button_set_inconsistent  (<em class="parameter"><code><a class="link" href="gtk3-GtkToggleButton.html#GtkToggleButton" title="struct GtkToggleButton"><span class="type">GtkToggleButton</span></a> *toggle_button</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> setting</code></em>);</pre>
<p>
If the user has selected a range of elements (such as some text or
spreadsheet cells) that are affected by a toggle button, and the
current values in that range are inconsistent, you may want to
display the toggle in an "in between" state. This function turns on
"in between" display.  Normally you would turn off the inconsistent
state again if the user toggles the toggle button. This has to be
done manually, <a class="link" href="gtk3-GtkToggleButton.html#gtk-toggle-button-set-inconsistent" title="gtk_toggle_button_set_inconsistent ()"><code class="function">gtk_toggle_button_set_inconsistent()</code></a> only affects
visual appearance, it doesn't affect the semantics of the button.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>toggle_button</code></em> :</span></p></td>
<td>a <a class="link" href="gtk3-GtkToggleButton.html#GtkToggleButton" title="struct GtkToggleButton"><span class="type">GtkToggleButton</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>setting</code></em> :</span></p></td>
<td>
<a href="../glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if state is inconsistent</td>
</tr>
</tbody>
</table></div>
</div>
</div>
</div>
<div class="footer">
<hr>
          Generated by GTK-Doc V1.18</div>
</body>
</html>